package com.zhanghe.mall.service;

import com.zhanghe.mall.pojo.CommodityClassification;
import com.zhanghe.mall.pojo.CommodityClassificationTree;
import com.zhanghe.mall.service.dto.AddClassficationDTO;
import com.zhanghe.mall.service.vo.CommodityClassificationTreeVO;

import java.util.List;

/**
 * CommodityClassificationService
 *
 * @author Clevo
 * @date 2018/7/4
 */
public interface CommodityClassificationService {
    /**
     * 添加分类
     * @param addClassficationDTO 需要添加的分类
     * @param parentTreeId  需要添加的分类的父分类
     * @return
     * @author Clevo
     * @date 2018/7/4 22:16
     */
    CommodityClassification addClassificationTree(AddClassficationDTO addClassficationDTO, Long parentTreeId);

    List<CommodityClassificationTree> findByAncestor_IdAndDistanceGreaterThan(Long ancestor_id, Long distance);

    List<CommodityClassificationTree> findByAncestor_IdAndDistance(Long ancestor_id, Long distance);

    /**
     * 获取所有顶级节点
     * @return
     */
    List<CommodityClassificationTree> getRootClassfication();

    /**
     * 获取某个节点的下级节点
     * @param classficationId
     * @return
     */
    List<CommodityClassificationTree> getSubClassfication(Long classficationId);

    /**
     * 获取商品分类的树形结构
     * @return
     */
    List<CommodityClassificationTreeVO> getClassificationTree();

    /**
     * 获取商品分类的下级分类(树形)
     * @param vo
     */
    void setSubClassficationTree(CommodityClassificationTreeVO vo);

    /**
     * 删除分类
     * @param classificationId
     */
    void deleteClassification(Long classificationId);
}
